package com.wsm.common.controller;

import com.wsm.common.utils.ShiroUtils;
import com.wsm.system.domain.UserDO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;

@Api(tags = "基础")
@Controller
public class BaseController {

	@ApiOperation("获取用户")
	public UserDO getUser() {
		return ShiroUtils.getUser();
	}

	@ApiOperation("获取用户ID")
	public Long getUserId() {
		return getUser().getUserId();
	}

	@ApiOperation("获取用户名")
	public String getUsername() {
		return getUser().getUsername();
	}
}